package com.fy.tt.entity;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.sql.ResultSet;


@Data
@NoArgsConstructor
@Table(name = "bls_sentence")
public class Sentence {
    //    @TableId(value = "id", type = IdType.AUTO)
    @Id
    @Column(name = "id")
    private Long id;

    //    @ApiModelProperty(value = "句子本身")
    @Column(name = "name")
    private String name;

    //    @ApiModelProperty(value = "相关描述")
    @Column(name = "description")
    private String description;

    //    @ApiModelProperty(value = "句型的巴克斯范式表示")
    @Column(name = "paradigm")
    private String paradigm;

    //    @ApiModelProperty(value = "最近一次更新时间")
//    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Column(name = "update_time")
    private Date updateTime;

    //    @ApiModelProperty(value = "0:未录入，1：已录入")
    @Column(name = "is_type_in")
    private Long isTypeIn;

    //    @ApiModelProperty(value = "0:禁用 1：待开发 2： 开发中 3：待审核 4：待发布 5：已发布")
    @Column(name = "status")
    private Long status;

    //    @ApiModelProperty(value = "所属场景区id（ObjBandID）")
    @Column(name = "band_obj_id")
    private Long bandObjId;

    public Sentence(ResultSet rs) {
        try {
            this.id = rs.getLong("id");
            this.name = rs.getString("name");
            this.description = rs.getString("description");
            this.paradigm = rs.getString("paradigm") ;
            this.updateTime = rs.getTimestamp("update_time") ;
            this.isTypeIn = rs.getLong("is_type_in");
            this.status = rs.getLong("status");
            this.bandObjId = rs.getLong("band_obj_id");
        }catch (Exception e){
            System.out.println(e.getCause());
        }
    }
}
